package com.bluesky.framework.config.mybatisplus.handler;

import com.baomidou.mybatisplus.extension.plugins.handler.DataPermissionHandler;
import com.bluesky.common.bo.SysRoleBO;
import com.bluesky.common.utils.SecurityUtils;
import net.sf.jsqlparser.expression.Expression;

import java.util.List;

/**
 * 自定义数据权限
 * @author Kevin
 */
public class CustomDataPermissionHandler implements DataPermissionHandler {
    @Override
    public Expression getSqlSegment(Expression where, String mappedStatementId) {
        List<SysRoleBO> sysRoleBOList = SecurityUtils.getLoginUser().getSysUser().getRoles();
        sysRoleBOList.forEach(item -> {
            item.getDataScope();

        });
        return null;
    }
}
